<template>
  <div class="allOrder order">
    <div class="order-list" v-if="orderList.length>0">
      <div class="order-goods" v-for="(goods,index) in orderList" :key="index">
        <div class="order-hd">
          <p class="g-store">
            {{goods.shopTitle}}
            <van-icon name="arrow" />
          </p>
          <p class="g-state" v-if="goods.isPay">等待商家发货</p>
          <p class="g-state" v-else>交易进行中</p>
        </div>
        <div class="order-bd">
          <img :src="goods.pictUrl" alt="">
          <div class="g-desc">
            <p class="g-title">{{goods.title | ginfofmt}}</p>
            <p class="g-price"><span>单价:</span> {{goods.price | gpricefmt}} 元</p>
            <p class="g-count"><span>数量:</span> {{goods.count}} 件</p>
            <p class="g-total"><span>总价:</span> <b>{{goods.count*goods.price | gpricefmt}} 元</b> </p>
            <p class="g-addtime"><span>创建订单时间:</span> {{goods.add_time | datefmt}}</p>
          </div>
          <a v-show="!goods.isPay" href="/#/home/payment" class="to-payment">去支付</a>
        </div>
        <div class="order-operate">
        </div>
      </div>
    </div>
    <div class="no-order" v-else>
      <p>您还未产生订单</p>
    </div>
  </div>
</template>
<script>
import '@/assets/css/order/order.scss'
import { mapState } from 'vuex'
export default {
  data() {
    return {

    }
  },
  computed: {
    ...mapState({
      orderList: state => state.cart.orderList
    })
  }
}
</script>
<style lang="scss" >
.to-payment {
  color: #0092ff;
}
</style>